<!doctype html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title><?=$title;?></title>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible">
<meta content="<?=$keyword;?>" name="keyword">
<meta content="<?=$description;?>" name="description">
<link type="text/css" href="<?=STATIC_URL;?>css/common.css" rev="stylesheet" rel="stylesheet">
<link type="text/css" href="<?=STATIC_URL;?>css/html.css" rev="stylesheet" rel="stylesheet">
<link href="<?=STATIC_URL;?>favicon.ico" type="image/x-icon" rel="icon" />
<link href="<?=STATIC_URL;?>favicon.ico" type="image/x-icon" rel="shortcut icon" />
<body>
<div id="container">
  <? include 'com-header.tpl.php'; ?>
  <!------------------------------------>

  <div id="about_info">
    <div id="about_left">
      <div class="about_left_menu">
        <ul>
          <li class="selected">餐厅加盟</li>
        </ul>
      </div>
    </div>
    <div id="about_right">
      <div class="about_right_content">
        <div class="content_title">餐厅加盟</div>
        <p style="color:#C00">&nbsp; 请先填写下面联络信息，本站工作人员会尽快与您联系。咨询电话：0411-83638475</p>
        <p>&nbsp; </p>
        <form action="<?=Base::FrontUrl('html', 'apply');?>" id="form1" method="post">
        <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#ffffff" class="applyform">
          <tr bgcolor="#EFEFEF">
            <th width="100">餐厅名称</th>
            <td><input name="shopname" type="text" id="shopname" value="" size="50"></td>
          </tr>
          <tr bgcolor="#F9F9F9">
            <th>所属区域</th>
            <td><select id="zone_id" name="zone_id" class="ssel">
                <option value="0" selected="">请选择...</option>
              </select>
              <select id="subzone_id" name="subzone_id" class="ssel">
                <option value="0" selected="">请选择...</option>
              </select></td>
          </tr>
          <tr bgcolor="#EFEFEF">
            <th>详细地址</th>
            <td><input name="address" type="text" id="address" value="" size="50"></td>
          </tr>
          <tr bgcolor="#F9F9F9">
            <th>联 系 人</th>
            <td><input name="author" type="text" id="author" value=""></td>
          </tr>
          <tr bgcolor="#EFEFEF">
            <th>QQ/MSN</th>
            <td><input name="imcode" type="text" id="imcode" value="" size="50">
              (请填写您常用的号码)</td>
          </tr>
          <tr bgcolor="#F9F9F9">
            <th>送餐电话</th>
            <td><input name="telphone" type="text" id="telphone" value="" size="50">
              (多个号码用逗号分隔)</td>
          </tr>
          <tr bgcolor="#EFEFEF">
            <th>是否送餐</th>
            <td>
              <input name="deliver" type="radio" id="deliver_1" value="1" checked> 送餐
              &nbsp;
              <input name="deliver" type="radio" id="deliver_0" value="0"> 不送餐</td>
          </tr>
          <tr bgcolor="#F9F9F9">
            <th>配送说明</th>
            <td><textarea name="description" id="description" cols="50" rows="6">送餐时间：
起送价格：0元
起送分数：1份
送餐区域：

其他说明：</textarea></td>
          </tr>
          <tr bgcolor="#EFEFEF">
            <th>其他信息</th>
            <td><textarea name="memo" id="memo" cols="50" rows="6"></textarea></td>
          </tr>
        </table>
        <p>&nbsp;</p>
        <p align="center"><button type="submit" class="submit">提交表单</button></p>
        <input type="hidden" name="dosubmit" value="yes" />
        <input type="hidden" name="isajax" value="1" />
        </form>
      </div>
    </div>
    <div class="clear"></div>
  </div>

  <!------------------------------------>
  <? include 'com-footer.tpl.php'; ?>

<script language="javascript" type="text/javascript" src="<?=STATIC_URL;?>js/jquery-1.7.1.min.js"></script>
<script language="javascript" type="text/javascript" src="<?=STATIC_URL;?>js/jquery.form.min.js"></script>
<script language="javascript" type="text/javascript">
function zone_select(obj, zone_id, subzone_id){
	zone_id    = parseInt(zone_id);
	if(isNaN(zone_id) || zone_id == undefined) {
		zone_id = 0;
	}
	subzone_id = parseInt(subzone_id);
	if(isNaN(subzone_id) || subzone_id == undefined) {
		subzone_id = 0;
	}
	$.get(
		'/tools/zoneOption?pid=' + zone_id + '&zid=' + subzone_id,
		function(result){
			$(obj).html('<option value="0" selected>请选择...</option>' + result);
		}
	);
}
function checkForm(){
	if($("#shopname").val() == ""){
		alert("餐厅名称没有填写");
		$("#shopname").focus();
		return false;
	}
	if($("#zone_id").val() == 0 || $("#subzone_id").val() == 0){
		alert("请选择餐厅所属区域");
		$("#zone_id").focus();
		return false;
	}
	if($("#address").val() == ""){
		alert("详细地址没有填写");
		$("#address").focus();
		return false;
	}
	if($("#author").val() == ""){
		alert("联系人没有填写");
		$("#author").focus();
		return false;
	}
	return true;
}
$(document).ready(function() {
	if($("#zone_id")){
		var zone_id    = 0;
		var subzone_id = 0;
		zone_select("#zone_id", 0, zone_id);
		if(zone_id >0){
			zone_select("#subzone_id", zone_id, subzone_id);
		}

		$('#zone_id').change(function(){
			zone_select("#subzone_id", $(this).val());
		});
	}

	$('#form1').submit(function() {
		// 提交表单
		$(this).ajaxSubmit({
			dataType:"json",
			beforeSubmit:checkForm,
			success:function(data){
				if(!data.error){
					alert('操作成功！工作人员稍后会于您取得联系。');
					$('#form1').resetForm();
				}else{
					alert(data.message);
				}
			}
		});
		return false;
	});
});
</script>
</div>
</body>
</html>